var api = require('../../utils/api.js');
var date = require('../../utils/date.js');


Page({

    /**
     * 页面的初始数据
     */
    data: {
        list:[],
        ids:''
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {

        var that=this;
        api.get({
            url: 'common/getmyquyu',
            data: {},
            success: data => {
                that.setData({
                    list:data.data
                })
            }
        });
    },

    selectme(ret){
        console.log(ret);

        var id=ret.currentTarget.dataset.id;

        this.setData({
            ids:id
        })

    },

    submits(){

        var ids=this.data.ids;
        var that=this;

        if(!ids){
            wx.showToast({
              title: '请选择区域',
              icon:'none'
            })
            return false;
        }

      
        api.get({
            url: 'user/setmyquyu',
            data: {ids:ids},
            success: data => {
                wx.navigateBack();
            }
        });


    }

})